package com.woniuxy.demo.epai.service.impl;

import com.woniuxy.demo.epai.model.Members;
import com.woniuxy.demo.epai.dao.MembersMapper;
import com.woniuxy.demo.epai.service.IMembersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 会员表 服务实现类
 * </p>
 *
 * @author epai
 * @since 2021-04-12
 */
@Service
public class MembersServiceImpl extends ServiceImpl<MembersMapper, Members> implements IMembersService {

    @Autowired
    private MembersMapper membersMapper;

    @Override
    @Cacheable(value="members",key = "'members_'+#uid")
    public Members getMembers(int uid) {
        Members members = membersMapper.findByUid(uid);

        return members;
    }
}
